package cn.iocoder.yudao.module.system.dal.mysql.productionplan;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.productionplan.ProductionPlanDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.controller.admin.productionplan.vo.*;

/**
 * 生产计划 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface ProductionPlanMapper extends BaseMapperX<ProductionPlanDO> {

    default PageResult<ProductionPlanDO> selectPage(ProductionPlanPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ProductionPlanDO>()
                .eqIfPresent(ProductionPlanDO::getNumber, reqVO.getNumber())
                .betweenIfPresent(ProductionPlanDO::getOpenStime, reqVO.getOpenStime())
                .betweenIfPresent(ProductionPlanDO::getOpenEtime, reqVO.getOpenEtime())
                .betweenIfPresent(ProductionPlanDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ProductionPlanDO::getId));
    }

}
